package com.hjj.controller;

import com.hjj.services.ProductService;
import org.apache.dubbo.config.annotation.DubboReference;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.math.BigDecimal;

@RestController
@RequestMapping("product")
@CrossOrigin
public class ProductController {
    @DubboReference(check = false)
    private ProductService productService;

    @GetMapping("rate")
    public BigDecimal getRate(){
        return productService.getAvgRate();
    }
}
